Circuits
About Circuits are editable networks of components that can be used in Custom Rooms in Sandbox room mode to execute basic programs, for example, to keep track of the score, stop the game, and/or announce a winner. These networks are made out of configurable "chips," which can be found on the “Chips” tab of the Maker Pen menu, and specific items from the Sandbox Machine. The pins of the chips can be connected with the Connect tool of the Maker Pen. Visibility of circuits can be controlled in the This Room Menu of the Watch Menu. If you have questions about specific circuits or the system in general, don't hesitate to ask them in the #circuits channel of Against Gravity's discord. Examples of Circuits Several examples of useful circuits are documented in Circuit Diagrams. You can see some circuits in Rec Room by going to Custom Rooms. * ^circuitdemo * ^circuitrecipies * ^highscorecircuit * ^buzzercircuit * ^jdCalculator * ^hackerspace * ^elektronicbowling To find these rooms, open your Watch Menu, click on the Custom Rooms Menu and then the Search tab. Click on "Enter name here," type in the name, and then click the "Search" button. Some of the rooms are also accessible via the custom room ^FeaturedRooms. Chips This section describes all chips that are available in the "Chips" tab of the Maker Pen menu. You might have to turn on visibility of circuits in the This Room Menu of the Watch Menu to get access to this tab. The pins of the chips can be connected with the Connect tool of the Maker Pen. In general, input pins to a chip are on the left, and output pins from the chip are on the right. Input pins that are not connected to anything receive a 0 signal ("false"). A "true" signal (any number unequal to 0) on "R" pins will reset a chip, i.e., produce a 0 output. Examples of circuits with most of these chips are on the page Circuit Diagrams. Output Output chips display the numeric value input on the red pin on the left. Message Message chips display a message to all players in a room when the input pin on the left is set to "true", i.e., any number unequal to 0. The message can be edited with the Edit tool of the Maker Pen. This can be controlled via buttons or other circuit components. Combinator Combinator chips do mathematical operations on inputs. Currently, addition, subtraction, multiplication, division and modulo (remainder after division) operations are supported. You can set the operation with the Edit tool of the Maker Pen. A common application of the addition operation is to increment a score. Note that to increment a score, you need to connect the output of the chip to one input in order to add the new score to it. A common application of the modulo operation is to toggle between 0 and 1: by computing an input value modulo 2, the result will toggle between 0 and 1 if the input is incremented in steps of 1. Comparer Comparer chips do mathematical comparisons, including equals, not equals, greater than and less than operations. Output is 0 for "false", and 1 for "true". You can set the comparison with the Edit tool of the Maker Pen. Timer Timer chips can be used in countdown or looping countdown mode. The red pin on the left is an on/off switch; the timer must be held in an “on” state (signal unqual to 0) to operate; thus, a button press, which only sends a momentary 1, cannot run a timer on its own. The green pin is an input for the amount of time (in seconds) that a timer should operate. The red pin on the right outputs a momentary signal 1 when the timer expires (similar to goals and buttons). The green pin on the right is the current time left on a countdown. Delay Delay chips take a signal passed on the red pin, wait the amount of time provided by the green pin (in seconds), and then output the signal from the red input pin momentarily on the red output pin before outputting 0 again (even if the input stays on a different value). (Setting the time to 0 seconds delays the signal by 1 global update tick in the current version of Rec Room.) Choice Choice chips act as logic gates, supporting "And", "Or", and "Not" operations. The output is a "true" (1) or "false" (0) signal on the right side. For "And", the output is "true" (1) if and only if all applied input signals are "true" (unequal to 0). For "Or" the output is "true" (1) if and only if any of the applied input signals is "true" (unequal to 0). For "Not", the output is "true" (1) if and only if the input signal is "false" (0). You can set the operation with the Edit tool of the Maker Pen. Variable Variable chips hold three integer numbers that are available as output on the pins on the right side. You can set the values with the Edit tool of the Maker Pen. Start Game A signal greater than 0 on the red pin starts the game when any of the input signals changes. A signal greater than 0 on the green pin stops the game when any of the input signals changes. Game State Sends a momentary output of 1 on the appropriate pin when the game state changes: * Red = Game Start * Green = Game End * Blue = Pre-Game Start Set Score A Set Score chip's input on the Red pin will display on the scoreboard as red team’s score, and the input on the Green pin will display the blue team’s score. Score Scores from the scoreboard are output on the Red and Green pins for the Red and Blue teams respectively. This can be used to make announcements about the score. Other Components Several items from the Sandbox Machine, such as the player and object goals, have outputs that can be connected to circuits. In particular, the button will send a momentary "true" (1) signal when pushed. The text on the button may be edited via the Edit tool of the Maker Pen. Some items from the Sandbox Machine have inputs that can be connected to circuits. One example is the sign. Its text can be edited via the Edit tool of the Maker Pen. The input to the sign (e.g., the remaining time or a score) can be displayed on the sign by using the text string "{R}" when modifying the sign’s text via the Edit tool. Room Doors can be toggled between locked and unlocked via its input. "True" (any number unequal to 0) inputs lock the door, and "false" (0) inputs unlock the door. Pitfalls The current version of the game has some known pitfalls that can be hard to understand or find if not known. Connecting Frozen Objects Connecting frozen objects is currently not possible. You have to unfreeze both objects before connecting them. Value Range Circuits currently support only 32-bit singed integers. They range from −2,147,483,648 to 2,147,483,647 and cannot produce fractions or real numbers. Ring Evaluation Order Rings that consist of more than one chip do not have a defined evaluation entry point. That means the chip inside the ring store that gets evaluated first cannot be defined designing the circuit. Therefore they sometimes get evaluated in an unexpected order. For example the Number Pad often produces a 0 too much at the end (i.e. the result is 10 times what it should be). If the execution order of the chips inside a ring appears wrong, it helps to exchange the chips in the ring. To do so, swap the chip that appears to be executed first with the chip that should be executed first. Then swap their functions and connections. The result is the exact same circuit, only that the chips that execute the steps are different ones. The ring should then be evaluated in the desired order. Global Chip Update Tick The first example on the right demonstrates the issue. Note that the button is not connected to anything at all. Every time the button gets pressed, the output increases by 2. All chips in one room are evaluated every time any chip gets evaluated; otherwise they are usually not evaluated. The result may be confusing and counterintuitive - in particular if you rely on this "lazy" evaluation. For example a ring store that has an external input signal usually does not change until a signal is triggered. However, it does change when an unrelated signal in an unrelated circuit in the same room gets triggered. If you encounter values that appear to be changing randomly while building a circuit or when triggering signals at the other end of the room, this is probably the reason. The simplest way to reproduce this issue is to build an alternating circuit, for example by connecting the output of a Not chip to its input and observing the output. Currently there is no known workaround for this issue, other than designing the circuits in a way that they are not affected by it. (For an example, see the two variants of the Copy Value circuit: the first one is not affected by the issue but takes one more tick to perform its function.) According to Against Gravity, this issue is not a bug but a expected behavior. However they understand that it is confusing and are considering to change the expectation. To help you building circuits in a way that they are not affected by the global update, you can add the circuit on the right to your room during construction. It will constantly induce chip updates (about 10 per second), so you notice problems in your design early. Category:Tools